home *** CD-ROM | disk | FTP | other *** search
/ BMUG PD-ROM A / PD-ROM A.iso / Education / Math / LOC(Metric) / Style.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-27  |  2.9 KB  |  88 lines  |  [TEXT/KAHL]

  1. #ifndef STYLE_H
  2. #define STYLE_H
  3.  
  4. /************************************************************************/
  5. /* Name:  Style include file                                            */
  6. /*                                                                        */
  7. /* Purpose:  This include file redefines the syntax of a few             */
  8. /*     C keywords to be more Ada-like (or Modula-like, etc).            */
  9. /*                                                                        */
  10. /* Author:  Steve Nies                                                    */
  11. /*                                                                        */
  12. /* Date created: 28 April 89                                            */
  13. /*                                                                        */
  14. /* Disclaimer:  This software has been developed privately by the        */
  15. /*     Author and has been released into the Public Domain.  The        */
  16. /*     author makes no claims as to the correctness or suitability        */
  17. /*     of the software for the intended purpose.                        */
  18. /************************************************************************/
  19.  
  20. #include "ResourceDefs.h"
  21.  
  22. #define TBD StopAlert ( NotImplementedID, NULL )
  23.  /* Null word signifying an area To Be Defined that needs more work. */
  24.  
  25. typedef unsigned int  bit16;
  26. typedef unsigned long bit32;
  27. #define BIT( bitArray, whichbit ) (bitArray & whichbit)
  28. #define SETBIT( bitArray, whichbit, value ) (bitArray = bitArray & ~whichbit | value)
  29.  /* Bit array data type. */
  30.  
  31. typedef char *string;
  32.  /* C string data type. */
  33.  
  34. typedef void *address;
  35.  /* Address data type representing the address of an object in memory. */
  36.  
  37. #ifndef NULL
  38. #define NULL 0L
  39. #endif
  40.  /* Null pointer. */
  41.  
  42. #define STR255(string) *((Str255 *) string)
  43.  /* Type conversion from a C string to a Str255 data type pointer. */
  44.  
  45. void PStrCpy ( register address target, register address source );
  46.  /* Replace a Pascal target string with the contents of a Pascal source string. */
  47.  
  48. void PStrCat ( register address target, register address source );
  49.  /* Concatenate a Pascal source string to the end of a Pascal target string. */
  50.  
  51. Boolean PStrCmp ( register address target, register address source );
  52.  /* Return TRUE if two Pascal strings are identical (case sensitive) or FALSE otherwise. */
  53.  
  54. typedef void (*TVoidFuncObject) ( address value );
  55. typedef Boolean (*TBoolFuncObject) ( address value );
  56.  /* Apply functions, used for iteration across lists of classes, subclasses,   */
  57.  /* attributes, etc.  Use TVoidFuncInstance and TBoolFuncInstance, defined in  */
  58.  /* OMS.h, for iteration across relationships and instances.                   */
  59.  
  60. #define BEGIN {
  61. #define END }
  62. #define IF if (
  63. #define NOT !
  64. #define AND &&
  65. #define OR ||
  66. #define THEN ) {
  67. #define ELSE } else {
  68. #define ELSIF } else if (
  69. #define END_IF }
  70. #define WHILE while (
  71. #define LOOP ) {
  72. #define END_LOOP }
  73. #define REPEAT while (1) {
  74. #define END_REPEAT }
  75. #define FOR for (
  76. #define SWITCH switch (
  77. #define WHEN ) {
  78. #define CASE case
  79. #define DEFAULT default
  80. #define END_SWITCH }
  81. #define BREAK break
  82. #define EXIT break
  83. #define RETURN return
  84. #define IN    /* Indicates that data flows into a function. */
  85. #define OUT   /* Indicates that data flows out of a function. */
  86.  
  87. #endif /* STYLE_H */
  88.